package com.example.spinning.controller;

import com.example.spinning.bean.*;
import com.example.spinning.service.*;
import com.example.spinning.utils.ArrayToListUtils;
import com.example.spinning.utils.JsonToListUtils;
import com.example.spinning.utils.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 纺纱工艺管理模块
 * @author bayernxmt
 * @create 2020-07-28-16:24
 */
@RestController
@RequestMapping("/craftManagement")
public class CraftManagementController {

    @Autowired
    private DyeingService ds;

    @Autowired
    private DyeingInfoService dis;

//    @Autowired
//    private DyeService dyes;//Dye表已废除，用Dyeing和DyeingInfo代替

    @Autowired
    private WilleyService ws;

    @Autowired
    private WilleyInfoService wis;

//    @Autowired
//    private WoolService ws;//Wool表已废除，用Willey和WilleyInfo代替

    @Autowired
    private CardingService cs;

    @Autowired
    private MuleSpinnig125Service ms125s;

    @Autowired
    private MuleSpinning34Service ms34s;

    @Autowired
    private RingSpinningService rss;

    @Autowired
    private SpoolingWorkshop1Service sw1s;

    @Autowired
    private SpoolingWorkshop2Service sw2s;

    @Autowired
    private SpoolingService ss;

    @Autowired
    private DoublingService doublings;

    @Autowired
    private TfoService ts;

    @Autowired
    private CombedCottonService ccs;

    @Autowired
    private DrawingService drawings;

    @Autowired
    private RovingService rs;

    @Autowired
    private SpunYarnService sys;


//---------------------------------------染色外表-------------------------------------------
//----------------------------------------------------------------------------------------
    //查询所有工序信息
    @RequestMapping(value = "/selectAllDyeing", method = RequestMethod.GET)
    public Map<String,Object> selectAllDyeing(
            //1表示外表的当前页和每页显示条数，2表示内表的当前页和每页显示条数
            int current1,  int size1,int current2,  int size2
    )
    {
        PaginationResult pr = ds.selectAll(current1, size1);
        List<DyeingVo> dyeingVoList = ds.getDyeingVoList(pr.getList());
        for (DyeingVo element:dyeingVoList){
            DyeingInfo di = new DyeingInfo();
            di.setDyeing_id(element.getId());
            element.setDyeingInfos(dis.selectByMulParams(current2,size2,di).getList());
        }
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());//外表的条数
        map.put("dyeingAlls",dyeingVoList);//value为List<DyeingVo>
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectDyeingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectDyeingByMulParams(
            int current1, int size1, Dyeing dyeing,int current2,  int size2, String dateTime
    )
    {
        PaginationResult pr = ds.selectByMulParams(current1,size1,dyeing,dateTime);
        List<DyeingVo> dyeingVoList = ds.getDyeingVoList(pr.getList());
        for (DyeingVo element:dyeingVoList){
            DyeingInfo di = new DyeingInfo();
            di.setDyeing_id(element.getId());
            element.setDyeingInfos(dis.selectByMulParams(current2,size2,di).getList());
        }
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("dyeingAlls",dyeingVoList);//value为List<DyeingVo>
        return map;
    }

    //增加一条信息
    @Log(module = "染色工序",description = "增加一条染色外表记录")
    @RequestMapping(value = "/insertDyeing", method = RequestMethod.POST)
    public RespBean insertDyeing(Dyeing dyeing){
        int result = ds.insert(dyeing);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

//    //批量删除信息(包括只删除一条)
////    @Log(module = "染色工序",description = "删除一条(多条)染色记录")
////    @RequestMapping(value = "/deleteDye", method = RequestMethod.POST)
////    public RespBean deleteDyeById(@RequestBody String params) {
////        //JsonToListUtils.format(params) 返回值为一个List<Integer>
////        int result = dyes.delete(JsonToListUtils.format(params));
////        if (result!=0) {
////            return new RespBean("success", "删除成功!");
////        }
////        return new RespBean("error", "删除失败!");
////    }

    //批量删除信息(包括只删除一条)，同时要删除内表外键对应的记录。 应前端要求：参照DailyReportController实现
    @Log(module = "染色工序",description = "删除一条(多条)染色外表记录")
    @RequestMapping(value = "/deleteDyeing", method = RequestMethod.DELETE)
    public RespBean deleteDyeingById(Integer[] ids) {
        int result = ds.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "染色工序",description = "修改一条染色外表记录")
    @RequestMapping(value = "/updateDyeing", method = RequestMethod.PUT)
    public RespBean updateDyeing(Dyeing dyeing){
        int result = ds.update(dyeing);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

//---------------------------------------染色内表-------------------------------------------
//----------------------------------------------------------------------------------------
    //查询所有工序信息
    @RequestMapping(value = "/selectAllDyeingInfo", method = RequestMethod.GET)
    public Map<String,Object> selectAllDyeingInfo(
            int current,  int size
    )
    {
        PaginationResult pr = dis.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("dyeingInfos",pr.getList());
        return map;
    }

    //单条件查询（外键dyeing_id）共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectDyeingInfoByMul",method = RequestMethod.GET)
    public Map<String,Object> selectDyeingInfoByMulParams(
            int current, int size, DyeingInfo dyeingInfo
    )
    {
        PaginationResult pr = dis.selectByMulParams(current,size,dyeingInfo);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("dyeingInfos",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "染色工序",description = "增加一条染色内表记录")
    @RequestMapping(value = "/insertDyeingInfo", method = RequestMethod.POST)
    public RespBean insertDyeInfo(DyeingInfo dyeingInfo){
        int result = dis.insert(dyeingInfo);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)，应前端要求：参照DailyReportController实现
    @Log(module = "染色工序",description = "删除一条(多条)染色内表记录")
    @RequestMapping(value = "/deleteDyeingInfo", method = RequestMethod.DELETE)
    public RespBean deleteDyeingInfoById(Integer[] ids) {
        int result = dis.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "染色工序",description = "修改一条染色内表记录")
    @RequestMapping(value = "/updateDyeingInfo", method = RequestMethod.PUT)
    public RespBean updateDyeingInfo(DyeingInfo dyeingInfo){
        int result = dis.update(dyeingInfo);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

////---------------------------------------染色表-------------------------------------------
////----------------------------------------------------------------------------------------
//    //查询所有工序信息
//    @RequestMapping(value = "/selectAllDye", method = RequestMethod.GET)
//    public Map<String,Object> selectAllDye(
//            int current,  int size
//    )
//    {
//        PaginationResult pr = dyes.selectAll(current, size);
//        Map<String, Object> map = new HashMap<>();
//        map.put("totalCount",pr.getTotal());
//        map.put("dyes",pr.getList());
//        return map;
//    }
//
//
//    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
//    @RequestMapping(value = "/selectDyeByMul",method = RequestMethod.GET)
//    public Map<String,Object> selectDyeByMulParams(
//            int current, int size, Dye dye
//    )
//    {
//        PaginationResult pr = dyes.selectByMulParams(current,size,dye);
//        Map<String, Object> map = new HashMap<>();
//        map.put("totalCount",pr.getTotal());
//        map.put("dyes",pr.getList());
//        return map;
//    }
//
//    //增加一条信息
//    @Log(module = "染色工序",description = "增加一条染色记录")
//    @RequestMapping(value = "/insertDye", method = RequestMethod.POST)
//    public RespBean insertDye(Dye dye){
//        int result = dyes.insert(dye);
//        if (result == 1) {
//            return new RespBean("success", "添加成功!");
//        }
//        return new RespBean("error", "添加失败!");
//    }
//
////    //批量删除信息(包括只删除一条)
//////    @Log(module = "染色工序",description = "删除一条(多条)染色记录")
//////    @RequestMapping(value = "/deleteDye", method = RequestMethod.POST)
//////    public RespBean deleteDyeById(@RequestBody String params) {
//////        //JsonToListUtils.format(params) 返回值为一个List<Integer>
//////        int result = dyes.delete(JsonToListUtils.format(params));
//////        if (result!=0) {
//////            return new RespBean("success", "删除成功!");
//////        }
//////        return new RespBean("error", "删除失败!");
//////    }
//
//       //批量删除信息(包括只删除一条): 应前端要求：参照DailyReportController实现
//     @Log(module = "染色工序",description = "删除一条(多条)染色记录")
//     @RequestMapping(value = "/deleteDye", method = RequestMethod.DELETE)
//     public RespBean deleteDyeById(Integer[] ids) {
//       int result = dyes.delete(ArrayToListUtils.format(ids));
//       if (result!=0) {
//        return new RespBean("success", "删除成功!");
//       }
//       return new RespBean("error", "删除失败!");
//    }
//
//    //修改信息
//    @Log(module = "染色工序",description = "修改一条染色记录")
//    @RequestMapping(value = "/updateDye", method = RequestMethod.PUT)
//    public RespBean updateDye(Dye dye){
//        int result = dyes.update(dye);
//        if (result == 1) {
//            return new RespBean("success", "修改成功!");
//        }
//        return new RespBean("error", "修改失败!");
//    }



//---------------------------------------和毛外表-------------------------------------------
//----------------------------------------------------------------------------------------
    //查询所有工序信息
    @RequestMapping(value = "/selectAllWilley", method = RequestMethod.GET)
    public Map<String,Object> selectAllWilley(
            int current1,  int size1,int current2,  int size2
    )
    {
        PaginationResult pr = ws.selectAll(current1, size1);
        List<WilleyVo> willeyVoList = ws.getWilleyVoList(pr.getList());
        for (WilleyVo element:willeyVoList){
            WilleyInfo wi = new WilleyInfo();
            wi.setWilley_id(element.getId());
            element.setDyeingInfos(wis.selectByMulParams(current2,size2,wi).getList());
        }
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("willeyAlls",willeyVoList);
        return map;
    }

    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectWilleyByMul",method = RequestMethod.GET)
    public Map<String,Object> selectWilleyByMulParams(
            int current1,  int size1,int current2,  int size2,Willey willey, String dateTime
    )
    {
        PaginationResult pr = ws.selectByMulParams(current1,size1,willey,dateTime);
        List<WilleyVo> willeyVoList = ws.getWilleyVoList(pr.getList());
        for (WilleyVo element:willeyVoList){
            WilleyInfo wi = new WilleyInfo();
            wi.setWilley_id(element.getId());
            element.setDyeingInfos(wis.selectByMulParams(current2,size2,wi).getList());
        }
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("willeyAlls",willeyVoList);
        return map;
    }

    //增加一条信息
    @Log(module = "和毛工序",description = "增加一条和毛外表记录")
    @RequestMapping(value = "/insertWilley", method = RequestMethod.POST)
    public RespBean insertWilley(Willey willey){
        int result = ws.insert(willey);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)，同时要删除内表外键对应的记录。 应前端要求：参照DailyReportController实现
    @Log(module = "和毛工序",description = "删除一条(多条)和毛外表记录")
    @RequestMapping(value = "/deleteWilley", method = RequestMethod.DELETE)
    public RespBean deleteWilleyById(Integer[] ids) {
        int result = ws.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "和毛工序",description = "修改一条和毛外表记录")
    @RequestMapping(value = "/updateWilley", method = RequestMethod.PUT)
    public RespBean updateWilley(Willey willey){
        int result = ws.update(willey);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }


//---------------------------------------和毛内表-------------------------------------------
//----------------------------------------------------------------------------------------
    //查询所有工序信息
    @RequestMapping(value = "/selectAllWilleyInfo", method = RequestMethod.GET)
    public Map<String,Object> selectAllWilleyInfo(
            int current,  int size
    )
    {
        PaginationResult pr = wis.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("willeyInfos",pr.getList());
        return map;
    }

    //单条件查询（外键willey_id）共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectWilleyInfoByMul",method = RequestMethod.GET)
    public Map<String,Object> selectWilleyInfoByMulParams(
            int current, int size, WilleyInfo willeyInfo
    )
    {
        PaginationResult pr = wis.selectByMulParams(current,size,willeyInfo);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("willeyInfos",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "和毛工序",description = "增加一条和毛内表记录")
    @RequestMapping(value = "/insertWilleyInfo", method = RequestMethod.POST)
    public RespBean insertWilleyInfo(WilleyInfo willeyInfo){
        int result = wis.insert(willeyInfo);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)，应前端要求：参照DailyReportController实现
    @Log(module = "和毛工序",description = "删除一条(多条)和毛内表记录")
    @RequestMapping(value = "/deleteWilleyInfo", method = RequestMethod.DELETE)
    public RespBean deleteWilleyInfoById(Integer[] ids) {
        int result = wis.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "和毛工序",description = "修改一条和毛内表记录")
    @RequestMapping(value = "/updateWilleyInfo", method = RequestMethod.PUT)
    public RespBean updateWilleyInfo(WilleyInfo willeyInfo){
        int result = wis.update(willeyInfo);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    ////----------------------------------------------------------------------------------------------
////---------------------------------------和毛表-------------------------------------------------
////-----------------------------------------------------------------------------------------------
////查询所有的工序信息
//    @RequestMapping(value = "/selectAllWool", method = RequestMethod.GET)
//    public Map<String,Object> selectAllWool(
//            int current,  int size
//    )
//    {
//        PaginationResult pr = ws.selectAll(current, size);
//        Map<String, Object> map = new HashMap<>();
//        map.put("totalCount",pr.getTotal());
//        map.put("wools",pr.getList());
//        return map;
//    }
//
//
//    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
//    @RequestMapping(value = "/selectWoolByMul",method = RequestMethod.GET)
//    public Map<String,Object> selectWoolByMulParams(
//            int current,  int size, Wool wool
//    )
//    {
//        PaginationResult pr = ws.selectByMulParams(current,size,wool);
//        Map<String, Object> map = new HashMap<>();
//        map.put("totalCount",pr.getTotal());
//        map.put("wools",pr.getList());
//        return map;
//    }
//
//    //增加一条信息
//    @Log(module = "和毛工序",description = "增加一条和毛记录")
//    @RequestMapping(value = "/insertWool", method = RequestMethod.POST)
//    public RespBean insertWool(Wool wool){
//        int result = ws.insert(wool);
//        if (result == 1) {
//            return new RespBean("success", "添加成功!");
//        }
//        return new RespBean("error", "添加失败!");
//    }
//
//    //批量删除信息(包括只删除一条)
//    @Log(module = "和毛工序",description = "删除一条（多条）染色记录")
//    @RequestMapping(value = "/deleteWool", method = RequestMethod.DELETE)
//    public RespBean deleteWoolById(Integer[] ids) {
//        int result = ws.delete(ArrayToListUtils.format(ids));
//        if (result!=0) {
//            return new RespBean("success", "删除成功!");
//        }
//        return new RespBean("error", "删除失败!");
//    }
//
//    //修改信息
//    @Log(module = "和毛工序",description = "修改一条和毛记录")
//    @RequestMapping(value = "/updateWool", method = RequestMethod.PUT)
//    public RespBean updateWool(Wool wool){
//        int result = ws.update(wool);
//        if (result == 1) {
//            return new RespBean("success", "修改成功!");
//        }
//        return new RespBean("error", "修改失败!");
//    }


    //--------------------------------------------------------------------------------------------
//---------------------------------------梳毛表------------------------------------------------
//--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllCarding", method = RequestMethod.GET)
    public Map<String,Object> selectAllCarding(
            int current,  int size
    )
    {
        PaginationResult pr = cs.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("cardings",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectCardingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectCardingByMulParams(
            int current,  int size, Carding carding, String dateTime
    )
    {
        PaginationResult pr = cs.selectByMulParams(current,size,carding,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("cardings",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "梳毛工序",description = "增加一条梳毛记录")
    @RequestMapping(value = "/insertCarding", method = RequestMethod.POST)
    public RespBean insertCarding(Carding carding){
        int result = cs.insert(carding);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "梳毛工序",description = "删除一条（多条）梳毛记录")
    @RequestMapping(value = "/deleteCarding", method = RequestMethod.DELETE)
    public RespBean deleteCardingById(Integer[] ids) {
        int result = cs.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "梳毛工序",description = "修改一条梳毛记录")
    @RequestMapping(value = "/updateCarding", method = RequestMethod.PUT)
    public RespBean updateCarding(Carding carding){
        int result = cs.update(carding);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------细砂125表--------------------------------------------
//--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllMuleSpinning125", method = RequestMethod.GET)
    public Map<String,Object> selectAllMuleSpinning125(
            int current,  int size
    )
    {
        PaginationResult pr = ms125s.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("muleSpinning125s",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectMuleSpinning125ByMul",method = RequestMethod.GET)
    public Map<String,Object> selectMuleSpinning125ByMulParams(
            int current,  int size, MuleSpinning125 muleSpinning125, String dateTime
    )
    {
        PaginationResult pr = ms125s.selectByMulParams(current,size,muleSpinning125,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("muleSpinning125s",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "细纱125工序",description = "增加一条细纱125记录")
    @RequestMapping(value = "/insertSpinning125", method = RequestMethod.POST)
    public RespBean insertMuleSpinning125(MuleSpinning125 muleSpinning125){
        int result = ms125s.insert(muleSpinning125);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "细纱125工序",description = "删除一条（多条）细纱125记录")
    @RequestMapping(value = "/deleteMuleSpinning125", method = RequestMethod.DELETE)
    public RespBean deleteMuleSpinning125ById(Integer[] ids) {
        int result = ms125s.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "细纱125工序",description = "修改一条细纱125记录")
    @RequestMapping(value = "/updateMuleSpinning125", method = RequestMethod.PUT)
    public RespBean updateMuleSpinning125(MuleSpinning125 muleSpinning125){
        int result = ms125s.update(muleSpinning125);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------细砂34表----------------------------------------------
//--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllMuleSpinning34", method = RequestMethod.GET)
    public Map<String,Object> selectAllMuleSpinning34(
            int current,  int size
    )
    {
        PaginationResult pr = ms34s.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("muleSpinning34s",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectMuleSpinning34ByMul",method = RequestMethod.GET)
    public Map<String,Object> selectMuleSpinning34ByMulParams(
            int current,  int size, MuleSpinning34 muleSpinning34, String dateTime
    )
    {
        PaginationResult pr = ms34s.selectByMulParams(current,size,muleSpinning34,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("muleSpinning34s",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "细纱34工序",description = "增加一条细纱34记录")
    @RequestMapping(value = "/insertMuleSpinning34", method = RequestMethod.POST)
    public RespBean insertMuleSpinning34(MuleSpinning34 muleSpinning34){
        int result = ms34s.insert(muleSpinning34);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "细纱34工序",description = "删除一条（多条）细纱34记录")
    @RequestMapping(value = "/deleteMuleSpinning34", method = RequestMethod.DELETE)
    public RespBean deleteMuleSpinning34ById(Integer[] ids) {
        int result = ms34s.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "染细纱34工序",description = "修改一条细纱34记录")
    @RequestMapping(value = "/updateMuleSpinning34", method = RequestMethod.PUT)
    public RespBean updateMuleSpinning125(MuleSpinning34 muleSpinning34){
        int result = ms34s.update(muleSpinning34);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

//--------------------------------------------------------------------------------------------
//---------------------------------------细纱环锭纺表-------------------------------------------
//--------------------------------------------------------------------------------------------
//查询所有工序信息
//@RequestMapping(value = "/selectAllRingSpinning/{current}/{size}", method = RequestMethod.GET)
//public Map<String,Object> selectAllRingSpinning(
//        @PathVariable int current, @PathVariable int size
//)
//{
//    PaginationResult pr = rss.selectAll(current, size);
//    Map<String, Object> map = new HashMap<>();
//    map.put("totalCount",pr.getTotal());
//    map.put("ringSpinnings",pr.getList());
//    return map;
//}
//
//
//    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
//    @RequestMapping(value = "/selectRingSpinningByMul/{current}/{size}",method = RequestMethod.GET)
//    public Map<String,Object> selectRingSpinningByMulParams(
//            @PathVariable int current, @PathVariable int size, RingSpinning ringSpinning
//    )
//    {
//        PaginationResult pr = rss.selectByMulParams(current,size,ringSpinning);
//        Map<String, Object> map = new HashMap<>();
//        map.put("totalCount",pr.getTotal());
//        map.put("ringSpinnings",pr.getList());
//        return map;
//    }
//
//    //增加一条信息
//    @Log(module = "细纱环锭纺工序",description = "增加一条细纱环锭纺记录")
//    @RequestMapping(value = "/insertRingSpinning", method = RequestMethod.POST)
//    public RespBean insertRingSpinning(RingSpinning ringSpinning){
//        int result = rss.insert(ringSpinning);
//        if (result == 1) {
//            return new RespBean("success", "添加成功!");
//        }
//        return new RespBean("error", "添加失败!");
//    }
//
//    //批量删除信息(包括只删除一条)
//    @Log(module = "细纱环锭纺工序",description = "删除一条（多条）细纱环锭纺记录")
//    @RequestMapping(value = "/deleteRingSpinning", method = RequestMethod.DELETE)
//    public RespBean deleteRingSpinningById(List<Integer> ids) {
//        int result = rss.delete(ids);
//        if (result!=0) {
//            return new RespBean("success", "删除成功!");
//        }
//        return new RespBean("error", "删除失败!");
//    }
//
//    //修改信息
//    @Log(module = "细纱环锭纺工序",description = "修改一条细纱环锭纺记录")
//    @RequestMapping(value = "/updateRingSpinning", method = RequestMethod.PUT)
//    public RespBean updateRingSpinning(RingSpinning ringSpinning){
//        int result = rss.update(ringSpinning);
//        if (result == 1) {
//            return new RespBean("success", "修改成功!");
//        }
//        return new RespBean("error", "修改失败!");
//    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------络筒一车间表-------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllSpoolingWorkshop1", method = RequestMethod.GET)
    public Map<String,Object> selectAllSpoolingWorkshop1(
            int current,  int size
    )
    {
        PaginationResult pr = sw1s.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolingWorkshop1s",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectSpoolingWorkshop1ByMul",method = RequestMethod.GET)
    public Map<String,Object> selectSpoolingWorkshop1ByMulParams(
            int current,  int size, SpoolingWorkshop1 spoolingWorkshop1, String dateTime
    )
    {
        PaginationResult pr = sw1s.selectByMulParams(current,size,spoolingWorkshop1, dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolingWorkshop1s",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "络筒一车间工序",description = "增加一条络筒一车间记录")
    @RequestMapping(value = "/insertSpoolingWorkshop1", method = RequestMethod.POST)
    public RespBean insertSpoolingWorkshop1(SpoolingWorkshop1 spoolingWorkshop1){
        int result = sw1s.insert(spoolingWorkshop1);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "络筒一车间工序",description = "删除一条（多条）络筒一车间记录")
    @RequestMapping(value = "/deleteSpoolingWorkshop1", method = RequestMethod.DELETE)
    public RespBean deleteSpoolingWorkshop1ById(Integer[] ids) {
        int result = sw1s.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "络筒一车间工序",description = "修改一条络筒一车间记录")
    @RequestMapping(value = "/updateSpoolingWorkshop1", method = RequestMethod.PUT)
    public RespBean updateDye(SpoolingWorkshop1 spoolingWorkshop1){
        int result = sw1s.update(spoolingWorkshop1);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------络筒二车间表-------------------------------------------
    //--------------------------------------------------------------------------------------------
    //查询所有工序信息
    @RequestMapping(value = "/selectAllSpoolingWorkshop2", method = RequestMethod.GET)
    public Map<String,Object> selectAllSpoolingWorkshop2(
            int current,  int size
    )
    {
        PaginationResult pr = sw2s.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolingWorkshop2s",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectSpoolingWorkshop2ByMul",method = RequestMethod.GET)
    public Map<String,Object> selectSpoolingWorkshop2ByMulParams(
            int current,  int size, SpoolingWorkshop2 spoolingWorkshop2, String dateTime
    )
    {
        PaginationResult pr = sw2s.selectByMulParams(current,size,spoolingWorkshop2,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolingWorkshop2s",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "络筒二车间工序",description = "增加一条络筒二车间记录")
    @RequestMapping(value = "/insertSpoolingWorkshop2", method = RequestMethod.POST)
    public RespBean insertSpoolingWorkshop2(SpoolingWorkshop2 spoolingWorkshop2){
        int result = sw2s.insert(spoolingWorkshop2);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "络筒二车间工序",description = "删除一条（多条）络筒二车间记录")
    @RequestMapping(value = "/deleteSpoolingWorkshop2", method = RequestMethod.DELETE)
    public RespBean deleteSpoolingWorkshop2ById(Integer[] ids) {
        int result = sw2s.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "络筒二车间工序",description = "修改一条络筒二车间记录")
    @RequestMapping(value = "/updateSpoolingWorkshop2", method = RequestMethod.PUT)
    public RespBean updateDye(SpoolingWorkshop2 spoolingWorkshop2){
        int result = sw2s.update(spoolingWorkshop2);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }


    //--------------------------------------------------------------------------------------------
//---------------------------------------络筒三车间表-------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllSpooling", method = RequestMethod.GET)
    public Map<String,Object> selectAllSpooling(
            int current,  int size
    )
    {
        PaginationResult pr = ss.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolings",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectSpoolingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectSpoolingByMulParams(
            int current,  int size, Spooling spooling, String dateTime
    )
    {
        PaginationResult pr = ss.selectByMulParams(current,size,spooling,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spoolings",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "络筒三车间工序",description = "增加一条络筒三车间记录")
    @RequestMapping(value = "/insertSpooling", method = RequestMethod.POST)
    public RespBean insertSpooling(Spooling spooling){
        int result = ss.insert(spooling);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "络筒三车间工序",description = "删除一条（多条）络筒三车间记录")
    @RequestMapping(value = "/deleteSpooling", method = RequestMethod.DELETE)
    public RespBean deleteSpoolingById(Integer[] ids) {
        int result = ss.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "络筒三车间工序",description = "修改一条络筒三车间记录")
    @RequestMapping(value = "/updateSpooling", method = RequestMethod.PUT)
    public RespBean updateDye(Spooling spooling){
        int result = ss.update(spooling);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------并线表------------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllDoubling", method = RequestMethod.GET)
    public Map<String,Object> selectAllDoubling(
            int current,  int size
    )
    {
        PaginationResult pr = doublings.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("doublings",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectDoublingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectDoublingByMulParams(
            int current,  int size, Doubling doubling, String dateTime
    )
    {
        PaginationResult pr = doublings.selectByMulParams(current,size,doubling, dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("doublings",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "并线工序",description = "增加一条并线记录")
    @RequestMapping(value = "/insertDoubling", method = RequestMethod.POST)
    public RespBean insertDoubling(Doubling doubling){
        int result = doublings.insert(doubling);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "并线工序",description = "删除一条（多条）并线记录")
    @RequestMapping(value = "/deleteDoubling", method = RequestMethod.DELETE)
    public RespBean deleteDoublingById(Integer[] ids) {
        int result = doublings.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "并线工序",description = "更新一条并线记录")
    @RequestMapping(value = "/updateDoubling", method = RequestMethod.PUT)
    public RespBean updateDoubling(Doubling doubling){
        int result = doublings.update(doubling);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------倍捻表------------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllTfo", method = RequestMethod.GET)
    public Map<String,Object> selectAllTfo(
            int current,  int size
    )
    {
        PaginationResult pr = ts.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("tfos",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectTfoByMul",method = RequestMethod.GET)
    public Map<String,Object> selectTfoByMulParams(
            int current,  int size, Tfo tfo, String dateTime
    )
    {
        PaginationResult pr = ts.selectByMulParams(current,size,tfo,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("tfos",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "倍捻工序",description = "增加一条倍捻记录")
    @RequestMapping(value = "/insertTfo", method = RequestMethod.POST)
    public RespBean insertTfo(Tfo tfo){
        int result = ts.insert(tfo);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "倍捻工序",description = "删除一条（多条）倍捻记录")
    @RequestMapping(value = "/deleteTfo", method = RequestMethod.DELETE)
    public RespBean deleteTfoById(Integer[] ids) {
        int result = ts.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "倍捻工序",description = "修改一条倍捻记录")
    @RequestMapping(value = "/updateTfo", method = RequestMethod.PUT)
    public RespBean updateDoubling(Tfo tfo){
        int result = ts.update(tfo);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------梳棉表------------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllCombedCotton", method = RequestMethod.GET)
    public Map<String,Object> selectAllCombedCotton(
            int current,  int size
    )
    {
        PaginationResult pr = ccs.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("combedCottons",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectCombedCottonByMul",method = RequestMethod.GET)
    public Map<String,Object> selectCombedCottonByMulParams(
            int current,  int size, CombedCotton combedCotton, String dateTime
    )
    {
        PaginationResult pr = ccs.selectByMulParams(current,size,combedCotton,dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("combedCottons",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "梳棉工序",description = "增加一条梳棉记录")
    @RequestMapping(value = "/insertCombedCotton", method = RequestMethod.POST)
    public RespBean insertCombedCotton(CombedCotton combedCotton){
        int result = ccs.insert(combedCotton);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "梳棉工序",description = "删除一条（多条）梳棉记录")
    @RequestMapping(value = "/deleteCombedCotton", method = RequestMethod.DELETE)
    public RespBean deleteCombedCottonById(Integer[] ids) {
        int result = ccs.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "梳棉工序",description = "更新一条梳棉记录")
    @RequestMapping(value = "/updateCombedCotton", method = RequestMethod.PUT)
    public RespBean updateCombedCotton(CombedCotton combedCotton){
        int result = ccs.update(combedCotton);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //--------------------------------------------------------------------------------------------
//---------------------------------------并条表------------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllDrawing", method = RequestMethod.GET)
    public Map<String,Object> selectAllDrawing(
            int current,  int size
    )
    {
        PaginationResult pr = drawings.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("drawings",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectDrawingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectDrawingByMulParams(
            int current,  int size, Drawing drawing, String dateTime
    )
    {
        PaginationResult pr = drawings.selectByMulParams(current,size,drawing, dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("drawings",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "并条工序",description = "增加一条并条记录")
    @RequestMapping(value = "/insertDrawing", method = RequestMethod.POST)
    public RespBean insertDrawing(Drawing drawing){
        int result = drawings.insert(drawing);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "并条工序",description = "删除一条（多条）并条记录")
    @RequestMapping(value = "/deleteDrawing", method = RequestMethod.DELETE)
    public RespBean deleteDrawingById(Integer[] ids) {
        int result = drawings.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "并条工序",description = "修改一条并条记录")
    @RequestMapping(value = "/updateDrawing", method = RequestMethod.PUT)
    public RespBean updateDrawing(Drawing drawing){
        int result = drawings.update(drawing);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }


    //--------------------------------------------------------------------------------------------
    //---------------------------------------粗砂表------------------------------------------------
    //--------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllRoving", method = RequestMethod.GET)
    public Map<String,Object> selectAllRoving(
            int current,  int size
    )
    {
        PaginationResult pr = rs.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("rovings",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectRovingByMul",method = RequestMethod.GET)
    public Map<String,Object> selectRovingByMulParams(
            int current,  int size, Roving roving, String dateTime
    )
    {
        PaginationResult pr = rs.selectByMulParams(current,size,roving, dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("rovings",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "粗砂工序",description = "增加一条粗砂记录")
    @RequestMapping(value = "/insertRoving", method = RequestMethod.POST)
    public RespBean insertRoving(Roving roving){
        int result = rs.insert(roving);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "粗砂工序",description = "删除一条（多条）粗砂记录")
    @RequestMapping(value = "/deleteRoving", method = RequestMethod.DELETE)
    public RespBean deleteRovingById(Integer[] ids) {
        int result = rs.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "粗砂工序",description = "修改一条粗砂记录")
    @RequestMapping(value = "/updateRoving", method = RequestMethod.PUT)
    public RespBean updateRoving(Roving roving){
        int result = rs.update(roving);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

    //----------------------------------------------------------------------------------------------
    //---------------------------------------细纱表------------------------------------------------
//----------------------------------------------------------------------------------------------
//查询所有工序信息
    @RequestMapping(value = "/selectAllSpunYarn", method = RequestMethod.GET)
    public Map<String,Object> selectAllSpunYarn(
            int current,  int size
    )
    {
        PaginationResult pr = sys.selectAll(current, size);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spunyarns",pr.getList());
        return map;
    }


    //单、多条件查询共用一个方法：前台用params传，(name属性值要和表的字段名一样)
    @RequestMapping(value = "/selectSpunYarnByMul",method = RequestMethod.GET)
    public Map<String,Object> selectRovingByMulParams(
            int current,  int size, SpunYarn spunYarn, String dateTime
    )
    {
        PaginationResult pr = sys.selectByMulParams(current,size,spunYarn, dateTime);
        Map<String, Object> map = new HashMap<>();
        map.put("totalCount",pr.getTotal());
        map.put("spunyarns",pr.getList());
        return map;
    }

    //增加一条信息
    @Log(module = "细纱工序",description = "增加一条细纱记录")
    @RequestMapping(value = "/insertSpunYarn", method = RequestMethod.POST)
    public RespBean insertSpunYarn(SpunYarn spunYarn){
        int result = sys.insert(spunYarn);
        if (result == 1) {
            return new RespBean("success", "添加成功!");
        }
        return new RespBean("error", "添加失败!");
    }

    //批量删除信息(包括只删除一条)
    @Log(module = "细纱工序",description = "删除一条（多条）细纱记录")
    @RequestMapping(value = "/deleteSpunYarn", method = RequestMethod.DELETE)
    public RespBean deleteSpunYarnById(Integer[] ids) {
        int result = sys.delete(ArrayToListUtils.format(ids));
        if (result!=0) {
            return new RespBean("success", "删除成功!");
        }
        return new RespBean("error", "删除失败!");
    }

    //修改信息
    @Log(module = "细纱工序",description = "修改一条细纱记录")
    @RequestMapping(value = "/updateSpunYarn", method = RequestMethod.PUT)
    public RespBean updateSpunYarn(SpunYarn spunYarn){
        int result = sys.update(spunYarn);
        if (result == 1) {
            return new RespBean("success", "修改成功!");
        }
        return new RespBean("error", "修改失败!");
    }

}
